package de.hsowl.routemath.threedimensional.main

import org.lwjgl.opengl._
import de.hsowl.routemath.gui.elements.RectangleGL

/**
 * Created by IntelliJ IDEA.
 * User: Sascha Ortmann
 * Date: 19.03.11
 * Time: 16:13
 * To change this template use File | Settings | File Templates.
 */

class MainGUI {
  val DISPLAY_WIDTH = 800
  val DISPLAY_HEIGHT = 600
  val DISPLAY_TITEL = "Routemath 3D"
  Display.setDisplayMode(new DisplayMode(DISPLAY_WIDTH, DISPLAY_HEIGHT))
  Display.setTitle(DISPLAY_TITEL)
  Display.create

  GL11.glClearColor(1.0f, 1.0f, 1.0f, 1.0f)
  GL11.glEnable(GL11.GL_BLEND)
  GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
  GL11.glViewport(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT)
  GL11.glMatrixMode(GL11.GL_MODELVIEW);
  GL11.glLoadIdentity();

  while (!Display.isCloseRequested) {
    (new RectangleGL).render
    Display.update
  }
  Display.destroy
}